{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#   [Py4Hw User Guide](../UserGuide.ipynb)> 2.1 Bitwise Logic Operations"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**py4hw** supports the classic bitwise logic operations that you would expect to have in any programming language: and, or, not, xor. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import py4hw\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<py4hw.logic.simulation.Scope at 0x27b3d976fe0>"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sys = py4hw.HWSystem()\n",
    "a = py4hw.Wire(sys, 'a', 8)\n",
    "b = py4hw.Wire(sys, 'b', 8)\n",
    "c = py4hw.Wire(sys, 'c', 8)\n",
    "d = py4hw.Wire(sys, 'd', 8)\n",
    "e = py4hw.Wire(sys, 'e', 8)\n",
    "f = py4hw.Wire(sys, 'f', 8)\n",
    "g = py4hw.Wire(sys, 'g', 8)\n",
    "h = py4hw.Wire(sys, 'h', 8)\n",
    "\n",
    "py4hw.Constant(sys, 'a', 13, a)\n",
    "py4hw.Constant(sys, 'b', 25, b)\n",
    "py4hw.Constant(sys, 'd', 67, d)\n",
    "py4hw.Constant(sys, 'f', 32, f)\n",
    "\n",
    "#py4hw.Sequence(sys, '')\n",
    "py4hw.And2(sys, 'and', a, b, c)\n",
    "py4hw.Or2(sys, 'or', c, d, e)\n",
    "py4hw.Xor2(sys, 'xor', e, f, g)\n",
    "py4hw.Not(sys, 'not', g, h)\n",
    "\n",
    "py4hw.Scope(sys, 'h', h)\n",
    "\n",
    "# py4hw.debug.checkIntegrity(sys)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {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WrcuLHi9hxQOb8a8kv30/FfCjdYJe7PKNT9AQBQEhGq8iEoKKjA733vvfe0e/duRfrX19PVszusz+p73KzSros9yJb3SgAAoEAIVW70xhtvaOTIkZKkE2n7ND6um8qWK6sVy1cUei32IJtCq/gW+n4BACgpCFVusH37dpUrV04nT550LQtw2BV//icpK1Ll6+Y9JAMAAChe6KhuolKlSkmSsrKycgWq0aNHy+FwWFUWAAAoBLRU5WHdunX5Xve9997TmDFjlJqaKklyOBwaOnSoHnroIY0bN849BQIAgCKBUGWihx9+WA8//LDVZQAAAAtw+w8AAMAEhCoAAAATEKoAAABMQKgCAAAwAaEKAADABIQqAAAAExCqAAAATECoAgAAMAGhCgAAwASEKgAAABMQqgAAAExAqAIAADABoQoAAMAEhCoAAAATEKoAAABMQKgCAAAwAaEKAADABD5WF2CWhIQERUVFWV3GVSUkJFhdAgAAcKNiH6ocDockyel0Kj4+3uJq8pZTLwAA8CzFPlTFxsZq5MiRSkpKsrqUPDkcDsXGxlpdBgAAcAObYRiG1UUAAAAUd3RUBwAAMAGhCgAAwASEKgAAABMQqgAAAExAqAIAADABoQoAAMAEhCoAAAATEKoAAABMQKgCAAAwAaEKAADABIQqAAAAExCqAAAATECoAgAAMAGhCgAAwASEKgAAABMQqgAAAExAqAIAADABoQoAAMAEhCoAAAATEKoAAABMQKgCAAAwAaEKAADABIQqAAAAExCqAAAATECoAgAAMAGhCgAAwASEKgAAABMQqgAAAExAqAIAADABoQoAAMAEhCoAAAATEKoAAABMQKgCAAAwAaEKAADABIQqAAAAExCqAAAATECoAgAAMAGhCgAAwASEKgAAABMQqgAAAExAqAIAADABoQoAAMAEhCoAAAATEKoAAABMQKgCAAAwwf8D5rLMqjuDcRwAAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 745x408 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "sch = py4hw.Schematic(sys)\n",
    "sch.draw()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Scope [h]:\n",
      "h=148\n",
      "----------\n",
      "Scope [h]:\n",
      "h=148\n",
      "----------\n",
      "Scope [h]:\n",
      "h=148\n",
      "----------\n",
      "Scope [h]:\n",
      "h=148\n",
      "----------\n",
      "Scope [h]:\n",
      "h=148\n",
      "----------\n"
     ]
    }
   ],
   "source": [
    "sim = sys.getSimulator()\n",
    "sim.clk(5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
